*************************************************************************************
***********************************ONLINE APPENDIX***********************************
*************************************************************************************


*******************
*Summary Statistic*
*******************

estpost tabulate female
esttab using female.csv, replace cells("b(label(Freq)) pct(fmt(2))") ///
varlabels(, blist(Total "{hline @width}{break}"))      ///
nonumber nomtitle noobs label
       
estpost tabulate edu
esttab using edu.csv, replace cells("b(label(Freq)) pct(fmt(2))") ///
varlabels(, blist(Total "{hline @width}{break}"))      ///
nonumber nomtitle noobs label

estpost tabulate generation
esttab using generation.csv, replace cells("b(label(Freq)) pct(fmt(2))") ///
varlabels(, blist(Total "{hline @width}{break}"))      ///
nonumber nomtitle noobs label

estpost tabulate race
esttab using race.csv, replace cells("b(label(Freq)) pct(fmt(2))") ///
varlabels(, blist(Total "{hline @width}{break}"))      ///
nonumber nomtitle noobs label

estpost tabulate CT2
esttab using ct.csv, replace cells("b(label(Freq)) pct(fmt(2))") ///
varlabels(, blist(Total "{hline @width}{break}"))      ///
nonumber nomtitle noobs label

estpost tabulate Party
esttab using edu.csv, replace cells("b(label(Freq)) pct(fmt(2))") ///
varlabels(, blist(Total "{hline @width}{break}"))      ///
nonumber nomtitle noobs label

estpost tabulate interest
esttab using  interest.csv, replace cells("b(label(Freq)) pct(fmt(2))") ///
varlabels(, blist(Total "{hline @width}{break}"))      ///
nonumber nomtitle noobs label

****************************
*Figures 1-3: Balance Tests*
****************************

est store marginal
forval i = 1/9 {
quietly mlogit treatment2 i.party i.edu i.generation female white interest , robust
margins, dydx(*) predict(outcome(`i')) post
estimates store marg`i'
estimates restore marginal
}


 *By Presidents
  coefplot marg1, bylabel("Pres. Stay Out") || ///
  marg2, bylabel("Pres. Back Down") || /// 
  marg3, bylabel("Pres. Justify") || ///
 	,drop(_cons) xline(0, lcolor(black)) msymb(O) msize(small) /// 
     scheme(plotplainblind)  ///
     subtitle(, size(medium) margin(small) justification(left) ///
     color(white) bcolor(black) bmargin(top_bottom)) ///
	 ylabel(,labsize(tiny) angle()) 

 *By Obama
 coefplot marg4, bylabel("Obama Stay Out") || /// 
  marg5, bylabel("Obama Back Down") || ///
  marg6, bylabel("Obama Justify") || ///
	,drop(_cons) xline(0, lcolor(black)) msymb(O) msize(small) /// 
     scheme(plotplainblind)  ///
     subtitle(, size(medium) margin(small) justification(left) ///
     color(white) bcolor(black) bmargin(top_bottom)) ///
	 ylabel(,labsize(tiny) angle()) 
	 
 *By Trump
  coefplot marg7, bylabel("Trump Stay Out") || ///
  marg8, bylabel("Trump Back Down") || ///
  marg9, bylabel("Trump Justify") || ///
 	,drop(_cons) xline(0, lcolor(black)) msymb(O) msize(small) /// 
     scheme(plotplainblind)  ///
     subtitle(, size(medium) margin(small) justification(left) ///
     color(white) bcolor(black) bmargin(top_bottom)) ///
	 ylabel(,labsize(tiny) angle()) 
  
  
  
***********************************************
*Table 1: VOTE CHOICE EFFECT ON AUDIENCE COSTS*
***********************************************

reg approve i.prestreatments##i.CT i.edu age female white interest  if pass==1 , robust
est store prestreat2
reg approve i.obamatreatments##i.CT i.edu age female white interest if pass==1 , robust
est store obamatreat2
reg approve i.trumptreatments##i.CT i.edu age female white interest if pass==1 , robust
est store trumptreat2


esttab  prestreat2 obamatreat2 trumptreat2 ///
using audiencecost2.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide 
 
 
 
*********************************
*Table 2: Including Independents*
*********************************

reg approve i.prestreatments##c.Party i.edu age female white interest  if pass==1 , robust
est store prestreat_7
reg approve i.obamatreatments##c.Party i.edu age female white interest if pass==1 , robust
est store obamatreat_7
reg approve i.trumptreatments##c.Party i.edu age female white interest if pass==1 , robust
est store trumptreat_7


esttab  prestreat_7 obamatreat_7 trumptreat_7 ///
using audiencecost7.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide   


**************************************
*Figure 4 & 5: Including Independents*
**************************************

*Trump
reg approve i.trumptreatments##c.Party i.edu age female white interest if pass==1 , robust
margins , dydx(trumptreatments)  at(Party=(0(1)6))
marginsplot, yline(0, lcolor(black) lpattern(dash) lwidth(medthick) ) recastci(rline) /// 
ciopts(fcolor(gs12) lpattern(dot) lwidth(vthick)) plotopt(msym(o) msize(vlarge)) ///
byopt(title("", size(large))) ///
ytitle("Difference in Approval between" "Treatments and Stay Out Group") ///
xlabel(,labsize(small) angle(45)) xtitle("") ///
legend(row(1) ring(1) position(6) order(1 "Back Down" 2 "Justify" )) ///
title("Trump Treatments")

*Obama
reg approve i.obamatreatments##c.Party i.edu age female white interest if pass==1 , robust
margins , dydx(obamatreatments)  at(Party=(0(1)6))
marginsplot, yline(0, lcolor(black) lpattern(dash) lwidth(medthick) ) recastci(rline) /// 
ciopts(fcolor(gs12) lpattern(dot) lwidth(vthick)) plotopt(msym(o) msize(vlarge)) ///
byopt(title("", size(large))) ///
ytitle("Difference in Approval between" "Treatments and Stay Out Group") ///
xlabel(,labsize(small) angle(45)) xtitle("") ///
legend(row(1) ring(1) position(6) order(1 "Back Down" 2 "Justify" )) ///
title("Obama Treatments")

 
*************************************
*Table 3: Controlling for Non-Voters*
*************************************

reg approve i.prestreatments##i.party i.edu age female white interest novote  if pass==1 , robust
est store prestreatnovote
reg approve i.obamatreatments##i.party i.edu age female white interest novote if pass==1 , robust
est store obamatreatnovote
reg approve i.trumptreatments##i.party i.edu age female white interest novote if pass==1 , robust
est store trumptreatnovote


esttab  prestreatnovote obamatreatnovote trumptreatnovote ///
using audiencecostnovote.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide 
  
****************************
*Table 4: Limited to Voters*
****************************

reg approve i.prestreatments##i.party i.edu age female white interest   if novote==0 & pass==1 , robust
est store prestreatnovote2
reg approve i.obamatreatments##i.party i.edu age female white interest  if novote==0 & pass==1 , robust
est store obamatreatnovote2
reg approve i.trumptreatments##i.party i.edu age female white interest  if novote==0 & pass==1 , robust
est store trumptreatnovote2


esttab  prestreatnovote2 obamatreatnovote2 trumptreatnovote2 ///
using audiencecostnovote2.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide    

************************************
*Table 5: Controlling for Awareness*
************************************

reg approve i.prestreatments##i.party i.edu age female white interest aware_nor  if pass==1 , robust
est store prestreataware
reg approve i.obamatreatments##i.party i.edu age female white interest aware_nor if pass==1 , robust
est store obamatreataware
reg approve i.trumptreatments##i.party i.edu age female white interest aware_nor if pass==1 , robust
est store trumptreataware


esttab  prestreataware obamatreataware trumptreataware ///
using audiencecostaware.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide  


******************************************************
*Table 6: Controlling for Awareness Limited to Voters*
******************************************************

reg approve i.prestreatments##i.party i.edu age female white interest aware_nor  if novote==0 & pass==1, robust
est store prestreataware
reg approve i.obamatreatments##i.party i.edu age female white interest aware_nor if novote==0 & pass==1, robust
est store obamatreataware
reg approve i.trumptreatments##i.party i.edu age female white interest aware_nor if novote==0 & pass==1, robust
est store trumptreataware


esttab  prestreataware obamatreataware trumptreataware ///
using audiencecostaware.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide   


**********************
*Table 7: Full Sample*
**********************

reg approve i.prestreatments##i.party i.edu age female white interest  , robust
est store prestreatf
reg approve i.obamatreatments##i.party i.edu age female white interest, robust
est store obamatreatf
reg approve i.trumptreatments##i.party i.edu age female white interest , robust
est store trumptreatf


esttab  prestreatf obamatreatf trumptreatf ///
using audiencecost1.rtf, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide


*****************************************
*Figure 11: Who is the Attacking Country*
*****************************************

foreach var of varlist russia  china iran iraq syria north_korea {

logit `var' i.treatments Party i.edu age female white interest aware_nor if pass==1
est store `var'
}

  
esttab   russia  china iran iraq syria north_korea  ///
using whoattack.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Russia" "Afganistan" "China" "Iran" "Iraq" "Syria" "North Korean" "Israel") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide   


  coefplot russia , bylabel("Russia") || ///
  china, bylabel("China") || ///
  iran, bylabel("Iran") || ///
  iraq, bylabel("Iraq") || ///
  syria, bylabel("Syria") || ///
  north_korea, bylabel("North Korea") || /// 
	,drop(_cons) xline(0, lcolor(black)) msymb(O) msize(small) /// 
     scheme(plotplainblind)  ///
     subtitle(, size(medium) margin(small) justification(left) ///
     color(white) bcolor(black) bmargin(top_bottom)) ///
	 ylabel(,labsize(tiny) angle()) 

  graph export "balanceAC", as(eps) replace
 

*******************************************
*Table 8: Individuals who think its Russia*
********************************************

reg approve i.prestreatments##i.party i.edu age female white interest  if pass==1 & russia==1 , robust
est store prestreat
reg approve i.obamatreatments##i.party i.edu age female white interest if pass==1 & russia==1 , robust
est store obamatreat
reg approve i.trumptreatments##i.party i.edu age female white interest if pass==1 & russia==1 , robust
est store trumptreat


esttab  prestreat obamatreat trumptreat ///
using audiencecost1.csv, b(%9.2f) se(%9.2f) label ///
addnotes(Note: Put your notes here.) nonum  ///
mtitles("Generic President" "President Obama" "President Trump") compress star(* 0.05)  replace ///
stats(N r2 , labels("Observations" "R-Squared") fmt(%9.2g)) ///
nobaselevels interaction(" X ") nogap collabels(,lhs()) wide 
 
